/*
 * Course.h
 *
 *  Created on: Apr 18, 2012
 *      Author: desilva
 */

#ifndef COURSE_H_
#define COURSE_H_
#include <string>


/**
 * A structure to represent a single course that was taken/attempted.
 */
struct Course
{
    /**
     * The type of grading options students could elect for.
     * <br />
     * <ul>
     *  <it>AF -- The A - F or traditional letter grade option</it>
     *  <it>SN -- The S/N or pass/fail grading option</it>
     *  <it>AUD -- Auditing the course (no credit)</it>
     * </ul>
     */
    enum GradingOption {AF,
                        SN,
                        AUD};

    //-------------------------------------------------------------------------
    //                            STRUCT DATA
    //-------------------------------------------------------------------------


    //-------------------------------------------------------------------------
    //DATA FROM TRANSCRIPT -- This information is actually on a transcript.
    //-------------------------------------------------------------------------
    /**
     * The term the course was taken in (ex: Fall).
     */
    std::string term;

    /**
     * The year the course was taken in (ex: 2010).
     */
    std::string year;

    /**
     * The subject of the course (ex: CSci).
     */
    std::string subject;

    /**
     * The number of the course (ex: 5801).
     */
    std::string course;

    /**
     * The number of credits attempted (the number of credits the class is
     * worth).
     */
    int         crdAttempted;

    /**
     * The number of credits earned (the number of credits awarded based on
     * the student receiving a sufficient grade in the course).
     */
    int         crdEarned;

    /**
     * The letter grade the student received (ex: B+).
     */
    std::string grade;

    /**
     * The number of grade points awarded to the student (ex: 9.999 for a B+
     * in a 3 credit course).
     */
    double      gradePoints;

    //-------------------------------------------------------------------------
    //ADDED IN FROM PEOPLESOFT (UMReports) -- This information is from an
    //  alternative database.
    //-------------------------------------------------------------------------
    /**
     * The grading option elected for the course.
     */
    GradingOption gradingOpt;


    //-------------------------------------------------------------------------
    //                   CONVENIENCE METHODS/CONSTRUCTORS
    //-------------------------------------------------------------------------
    /**
     * Creates an instance of a course.  For parameter information, see the
     * descriptions above each of the fields in the struct.
     */
    Course(std::string term,
           std::string year,
           std::string subject,
           std::string course,
           int         crdAttempted,
           int         crdEarned,
           std::string grade,
           double      gradePoints,
           GradingOption gradingOpt = AF)
    {
        this->term = term;
        this->year = year;
        this->subject = subject;
        this->course = course;
        this->crdAttempted = crdAttempted;
        this->crdEarned = crdEarned;
        this->grade = grade;
        this->gradePoints = gradePoints;
        this->gradingOpt = gradingOpt;
    }
};


#endif /* COURSE_H_ */
